change to bytes for python3 compatibility