added merge command and added writer to context