Thread wrappers were causing instant session closure