fix dead-lock