fixed a bug on the position of the array