fix some crash issue