Used raise instead of sys.exit