added registering functionality