better error handing on missing branch