Fix use of incorrect variable
Move js to bottom