making sqlcounter working