fixed readData if no data is defined