fixed error check in system.py