Inputstream closed and deleted a not used variable