fixed #118 maintain the selection when switching to edit mode