deadlock fix with timing