memory leak thing has been solved by buffering