patch for issue #601 & #602