Fixing a typo message
Adding Error handling