found bug, scope problem. self.threshold variable used in two files, for two different variables. oops.