made register and login pages redirect you to the index if the user is already logged in