handling for curl exception