avoid quit crash