Removed encode('ascii') for py3 compatibility