Changed to a new function for registering