added null check and html to required_tag