modify search code