fixing a sql syntax error