rewrite relay saving/handling so that we validate and save as expected (Bug #77537)
Merge pull request #82 from tablexi/relay_handling_77537

rewrite relay saving/handling so that we validate and save as expected