fixed I/O issue