Should there be a try, finally around these two lines to ensure that sender.close() is called?