some js functions