added relay functionality