Fix Can\'t set headers after they are sent.
Fix Can\'t set headers after they are sent.

jairelton/tree-gateway,Leanty/tree-gateway,Leanty/tree-gateway,jairelton/tree-gateway,Leanty/tree-gateway,jairelton/tree-gateway