Re-ordered the sending of data to server