fix invalid sql syntax w/ nolock