fixed IOError issue