added equals method of Query