fixing closure bugs within the editor js file