fix an issue where codemirror is not displayed onload