moved toggleEditMode