fixed a bug reported by sander