this fixes a bug when using multiple instances