added server compatibility for python 3