fix ref error and move file load handler to editor