changing search sql query