Now it can work with multiple instances