try to replace sync by ReentrantLock