Moved a little code little js code around