tweaked log_out functionality