moving js to the head (to improve debug)