sys.exit() wasn't called because of wrong indentation