add try-except protection for sys.argv