Working on mutex for debug output