Added logic to unregister notifications