Re-enabled the window closing event handler
Changed the keepalive interval to 30 seconds