more updates to curl function