added js functions