session handling first