edit search function