adding thread session id check