fix a bug in IO.hs