raise exception if scope is used without lambda