deletes javascript, adds scope