Created an io mutex in effort to address the multithreaded io crashing