Update app.js

I have issue when index is closed and then opened look like some shards are not restored and it throw exception