fix python crash