fix bug - exceeded memory