Changed login behavior to reflect requirements more accuratley