logout code changed