added register functionallity