wrapped session into structure but error needs to be part of the wrapped structure