Relays Fix

Relays would immediately exit because the streambytesread check was at the start of the loop when no bytes had been read.