ho risolto utilizzare queryCommandState e queryCommandValue