killing bugs in javascript