Update ats.js

finally fix the slice null bug...