resindex is now recalculated on each controller action
moved jsdate for heroku deployment