updated to work with new curl