add register functionality

add register functionality