How To Fix A Reference Error In Javascript