nicer implementation of the ioloop fix