fix bug reported by janis jukams