fixed IOerror issue