fix compatibility with older Python versions