fixes a deadlock condition