Fixes crashing error