Fix command thread