Fixed bug for multiple instances