ensure value exists before using it