fixed error message when invalid parameter is passed to readData
and the same for readData2