fix detection of difference of functions