Sending data to server is not working