Added logic to complete the registration process.