added some guards. todo turn this into correct Gen. still one failcase