made sure to close connection and inputstream after done reading
contents.