Trying to fix errors with array