Fixed JS order, removed misplaced debug