close method added to Query