fixed reference loading code (editor)