Handling Console exit