added mutex, please no more stupid auto format