added page init and destroy function.