Converted str to bytes for python3 compatibility