closes issue #38, resize causes loss of buffer