Add threading to commands