resizing and fix of concurrency issues