make sure streams get closed
load remote bundles and remove existing bundles if necessary