implemented friendlier fallback for when PHP scripts dont get parsed
moved scripts to bottom of body