fixes issue #1036
Merge pull request #1037 from ne0fhyk/fix_issue_1036

Fixes issue #1036