updated js functions