fix dead-locking when -U switch is used