Fixed Null Pointer Exception during Unregistration