fix login view logic