improve sudo and sed issue