When we instantiate a new program, we reserve an id, this causes an issue when instantiation fails, this id cannot be used anymore.
One way to solve this is by caching the last used id, and delete it if instantiation was successful, this will allow us to read from cache (can be a simple file) and check if we can save a program into this id (check its the id of the manager in use).