fix link
improve error handling