Fixed bug in process_tread_command