Modified code after login