Added check for null.