add curl error management