trying to implement check for undefined html in json