Fixed syntax error in forming SQL.