Search to database fix