fix sql bug.

issue #5