fixed unexpected crashing problem