removing count function in loop

fix #6