Added response.end after each write