Fix sql error when displaying tabs for one list