fixing functools.partial bug