adad old python unicode support
fix reference to undefined variable