Modified my_checkPageValidity() function.