Properly update the number of open pages