changing the query to only filter by instance id not starts/ends if instance id is set.