fixed reading of data and inserting into frame