array out of bound corrected