fix some missing js functions