using decode() instead of str() (thanks @justinvdm)