Implemented OutOfMemory prevention