moved some javascript