Fixed crashing problem