fix exfit function