Modified flushing memory logic