Update ats.js

still need to fix the "slice() null" bug.