updated script to send data in the correct format