add try/catch to xmlserver.close()
io_worker.close() ->  io_delegate.close()