little generator type checking