Fix bug: Out of memory error