Added check for null or empty