fixing IO issues