applied the suggestion of issue #226 (as noone had a better solution or explanation)
close #226