updated with a fix, had mutex as private