closing readers and input streams once they are used