updated to use latest typescript api