remove potental lockup and a racecondition