Add error handling for /unregister