Fix bug in relay mode