updated the patch for bug 874061 to address feedback from ehsan