- removed the unnecessary wait before closing the input stream