use std::mutex
fix recursive lock