Improve error handling..