fix array boundary