add patch for upstream bug #1240