database with search count working