update register function