programtical logout implemented