delete sync close function