Added type to the register function