bugfix: in some cases session was still None when imported with from