database search working