updated register code