added search include deleted query and test database