quick and dirty fix for 3.8 and 3.10. not tested very well...