order of replace