Add lock to Do func