using Lock to prevent re-write of the same object