register func