Added a check in case of key error.
Fixed a command syntax error.