fixed missing 'import sys'.