added func to reg