fix array type error in js