fix python compatibility