add function of synchronized