added error reporting code for situation where link fails