Chnage order of steps for search and replace