fixed bug with count