added CURL write function callback