fix bug: sql error.
Merge pull request #471 from forumbyr/master

fix bug: sql error.