refactoring to support centos as well
fixing detection of failed install