Fix bug out of memory