fix apply page switch template crash error.