fixed array out of bounds crash