fixed bug where tbs server wouldn't always exit properly