fix the huge sql bug
merge with the conflicted version