fix bug in cache management in BuilderFactory