Check the error flag when reading data.