add parallel close function