Closing the main log window causes app to quit