finish session implementation