this needs replaced with editor.focus();