Removed file.close()