fix OutOfMemory problem