add register function

....More convenient