Fixed sending header due to printf instead of log