fix for duplicates and out of scope pages