added redirects to index whenever a user is logged out, this fixes the internal server error that sometimes appeared