Move position of the "where" to properly limit the count.