Fixed broken JavaScript