added register functionality