add register functionality