fix issue 1780
Merge pull request #308 from niphlod/issue/1780

fixes issue 1780