found a bug, loops don't deallocate and pop each iteration