Added check to prevent bad things.