fixes to support relay code