Update index.js

fix undefined interval