sqlcounter returning wrong value?