fix KeyError message in commands method