Fixed the sql error