fix global name 'c' is not defined