My Condition to skip to a page is not working