Fixed crashing issue