fix deprecated generator detection