Removing unnecessary call to close