relay: change configuration procedure to be more foolproof