Removed  dontSendMultipart = true; outside of if block