fixed error in js