fixed a bug that caused crashing upon reopening of project