add curl exception handler