Client-Mode: Moved restart code outside of mutex lock to avoid potential deadlock in the output when lock is still held.