fixed more js bugs