Add register function.