move js out of the loop, still has the up/down no response issue