refactored method Proverka and changed name to CheckIfValidCommand