removed resource leak as reader was not closed