fixed a bug reported by Barry Evans