make ant demo thread safe