fixing attributes, making hyperlinks and error catching smarter, minor style refactor