initial register function