.encode('utf-8') added for python3 compatability

thanks alfred for spotting it