Added self-registration function.