Even better error handling, add prettyName function