Improve error handling more