Fixed KeyError in relaying