fixed leak in IO thread