set to binmode to prevent conversion errors