register to function