be more careful when checking values in input hash