added some curl stuff to send info to middle