fix some out of memory handle