add error-handling when allocation from memory pool is failed