diff --git a/cfg_checker/modules/packages/checker.py b/cfg_checker/modules/packages/checker.py
index c37ecee..972b12f 100644
--- a/cfg_checker/modules/packages/checker.py
+++ b/cfg_checker/modules/packages/checker.py
@@ -11,7 +11,7 @@
 
 
 class CloudPackageChecker(object):
-    def __init__(self):
+    def __init__(self, force_tag=None, exclude_keywords=[]):
         # Init salt master info
         if not salt_master.nodes:
             salt_master.nodes = salt_master.get_nodes()
@@ -29,6 +29,9 @@
                 )
             )
 
+        self.force_tag = force_tag
+        self.exclude_repos_keywords = exclude_keywords
+
     @staticmethod
     def presort_packages(all_packages, full=None):
         logger_cli.info("-> Presorting packages")
@@ -144,7 +147,7 @@
 
         for key in salt_master.nodes.keys():
             # due to much data to be passed from salt, it is happening in order
-            if key in _result:
+            if key in _result and _result[key]:
                 _text = _result[key]
                 try:
                     _dict = json.loads(_text[_text.find('{'):])
@@ -174,13 +177,23 @@
         """
         # Preload OpenStack release versions
         _desc = PkgVersions()
-
         logger_cli.info(
             "# Cross-comparing: Installed vs Candidates vs Release"
         )
         # shortcuts for this cloud values
         _os = salt_master.openstack_release
         _mcp = salt_master.mcp_release
+        _t = [self.force_tag] if self.force_tag else []
+        _t.append(_mcp)
+
+        logger_cli.info("# Tag search list: {}".format(", ".join(_t)))
+        logger_cli.info("# Openstack version: {}".format(_os))
+        logger_cli.info(
+            "# Release versions repos keyword exclude list: {}".format(
+                ", ".join(self.exclude_repos_keywords)
+            )
+        )
+
         # Progress class
         _progress = Progress(len(salt_master.nodes.keys()))
         _progress_index = 0
@@ -211,14 +224,42 @@
                     # get node attributes
                     _linux = salt_master.nodes[node_name]['linux_codename']
                     _arch = salt_master.nodes[node_name]['linux_arch']
-                    # get versions for this tag and repo headers
-                    # excluding 'nightly' repos
-                    _r = self.rm.get_filtered_versions(
-                        _name,
-                        tag=_mcp,
-                        include=[_os, _linux, _arch],
-                        exclude=["nightly"]
-                    )
+                    # get versions for tag, Openstack release and repo headers
+                    # excluding 'nightly' repos by default
+                    _r = {}
+                    # if there is a forced tag = use it
+                    if self.force_tag:
+                        _r = self.rm.get_filtered_versions(
+                            _name,
+                            tag=self.force_tag,
+                            include=[_os, _linux, _arch],
+                            exclude=self.exclude_repos_keywords
+                        )
+                        # if nothing found, look everywhere
+                        if not _r:
+                            _r = self.rm.get_filtered_versions(
+                                _name,
+                                tag=self.force_tag,
+                                include=[_linux, _arch],
+                                exclude=self.exclude_repos_keywords
+                            )
+                    # if nothing is found at this point,
+                    # repeat search using normal tags
+                    if not _r:
+                        _r = self.rm.get_filtered_versions(
+                            _name,
+                            tag=_mcp,
+                            include=[_os, _linux, _arch],
+                            exclude=self.exclude_repos_keywords
+                        )
+                    # Once again, if nothing found, look everywhere
+                    if not _r:
+                        _r = self.rm.get_filtered_versions(
+                            _name,
+                            tag=_mcp,
+                            include=[_linux, _arch],
+                            exclude=self.exclude_repos_keywords
+                        )
                     # repack versions in flat format
                     _vs = {}
                     _sections = {}
