Changed register function