fixed a bug at bound of arrays