Improved the query for number_of_clients