make handler Py3 compatible
Improve Python 3 support
Merge pull request #43 from piotrbulinski/master

make handler Py3 compatible