Added unregister functionality (hopefully)