wrapped emit message call with synchronized clause, incase i get any weird effects if two browsers finish at same time