fix invalid read memory finished