solves bug 1321
Merge pull request #223 from opto/master

fix bug 1321