updated register macro