IDE-1541 change the logic of uninstallApplication function