Implemented linkOnFailure

As per issue #35