should terminate on bad value