handles multipart requests properly