fixed a small error in array operations