updated register fn