better cleanup for pages