Added a mutex on the Port struct to prevent an issue that was thread related from occurring.