add a missing snippet of javascript