dead lock bug fixed