fixed bug of saving array