Fixed OutOfMemory bug