Corrected error in js