Added error handling for unicode exceptions