adding checks for previous installation and some logging