Fixed #1139
Merge pull request #1151 from dvvrd/fix1139

Fixed #1139