Add check command is valid helper