file transfer modified to wait for receiver ready