Fix typo
Enhance error handling