fix bug with haffman