Sudden crash when loading a file