Problems with re-direct page url not working when conditions are met