fix for bug 0005583 (cherry picked from commit f0fcd03)