Complete the registration function