Fix to db and intial code for JS on homepage