fix shell escaping bug in append() function