Connect replace mode to edit mode