Update legacy query