experimenting with HandleClose to make it safe