handle error for the link