fixed the bug reported by Bob #3