fix SQL call