addlogout function