relay main method