restoring previous logout code