Do not switch in edit mode if locked