Added Missing end to function m.register()

Missing end