implement close()