Get rid of stackoverflow error in IO.