Fixed a bug that was crashing unity