patch for issue #49