Skip to page condition not working correctly