fixed searching when db fields are NULL