long query fix