Modified edit_upstream