add blcoking for read data from buffer