fixed a missing import of 'sys'