fixes javascript reload bug