fixed bug reported by Gordan