updated the register handler