fix bug of crash on reload