fix bug write mutex