more error checking in dataReturned