Need to unregister handlers on close