Added sync mutex for thread safety.