added check on recv_bytes
minor changes