fix sql loading