trying to get console to exit cleanly