changed view so that it will redirect to the index page if the user already logged in