Trying to solve the last problem: when the buffer is refreshed I'm not able to read