fixed to new buffered structure. not tested yet