changed to be in sync with current javascript api