fixed an issue with samples buffering