Changed the transition to edit mode so that it is able to work without d...

Changed the transition to edit mode so that it is able to work without displaying the preview mode and not lead to a crash.