prior_source is added to gating method for gatingTemplate class. close #13