changed all #[] calls of hashes and arrays to #fetch