Update custom.js

fix get data of index - 1