fix sql call