avoid dead lock