added js functions to add threats