added register function