fixed issue #357
Merge pull request #359 from safiyu/issues

fixed issue #357 & #358