fix (potential) deadlock