Update index.js

Check database status