fix exception
also set Content-Type