fixed r/w deadlock