finishes log-in-log-out