fixed: array out of bounds access