#3292 fixed more thread safety issues