fix for bug 3583 from Mike Su