added setInSession, modified constructor