Added check for null strings