database searched count working