changed js to optimize front page