Implement a Mutex to solve problems with threads
Fix corrent default value