incorporating logout code