BugId:104520 - moved deleted page check to more appropriate place and tw...

...eaked the logic a little bit