added sending file logic