correcting Resource leak