Added Missing end to function m.register()