modify the logic of register