fixed resign crash and some others