free more resources

use unset to free resources better