close response and change way struct is created