added read and write valid bits