fixed a bug in PR #258