fix foundation reinit issue