add memory debugging