Application gracefully exits on browser close