add memory handler