js fix and initial codes