assert check in set_value to avoid panics