Add init session preserved state function and bug fixes