modify search function