changed for detecting crash