Fix trad and sql error