fixing search funciton after adding user registration