add js helper functions