replaced window listener with shutdown hook
added shutdown hook to base console