added checks for different kind of pages