add function to change state of commande