added proper dependency handling