trying to fix bug when two instances run together