fixes to handle relay errors