fixing issue #555
Merge pull request #560 from yilongli/fixing-issue-555

fix issue #555