fixing serial reads/writes