had to rewrite close()