throw exception instead of system.exit