make append and prepend modify in place