Remove the unregisterEvents function, register events using registerEvents. This avoids the user having to remember these things