Fix Typo
Improved error handling