fixed a sql bug