added file.close()