working demo register functionality