Change synchronization by sync(Object) to ReentrantLock