added checkings on controller html rendering