Added automatic exit on server, can be overridden