fix bug reported by Marcus