Fixing an array issue