hopefully fix sql problems