changed Output to append instead of replace