Fix bug when creating ApexPage