Added hostile takeover function replaceFile