fix double append/prepend