completed registerEvents()