changed read mode to 'rb' for windows