fix it, but not sure about the performance
Merge pull request #1 from keshin/master

fix it, but not sure about the performance