switch to sed and controll the return value