curl function modification