add func to query