replace return with location change