bug createCountQuery