Added error message if curl failed