Updated registration function.