Added error checking and links