Fixing bug in editor saving