added some js functions