Redirect to main page if in invalid state