reinstall logic