cleaned up login behavior