Attempted fix at pagesBefore