bugfix
better memory usage