reading data in main loop
todo addded