adjust session creation to local conditions
remove debug code