Better search function fix