fixed issue #781
Merge pull request #797 from ne0fhyk/fix_issue_781

Fixed issue #781