Modify search function