fix deadlock; recursive locking