add a (hopefully effective) mutex to id