register function finished