Remove query if present