added a curl function