Fix bug that text not loaded when opening file