fixed a bug where a page could have different weight in different context