Fixed response writing in Controller sample