fix "ReferenceError: local is not defined"