add exception handler for shared memory