Bug fix, spelling mistake and also added a type check before de-registering event.