move creating pages into pagebefore event
move creating hot page into pagebefore event