fixed bug due to scipy version difference in behavior