Added logic to address cache miss for both read and write misses.