fixed memory consumption problem