sending the data to the server correctly