fixed an issue within retrieve_instances