fix query lifetime