Call close after the callback