fix peeked data handling