Use OCurl properly: writefunction can be called more than once!