fixing crash on reload