fixed issue 466

fixed issue 376
Merge pull request #483 from safiyu/newissue

fixed issue 466, 376.