fix Python3 compatibility