run cmd in another thread to avoid ui block