Fix python 3 input compatiblity