added leg_session variable