closing adapter after scan