search function fix