put close() wherever it wasnt being called