Redirect conditions not working