fixed typo in key and added try/except solution