Fixed bug where pages on forms dont get destroyed properly