Added close method when writing response to Http Client