Added check for null value