Fixed an sql error