fix a destructure bug and a lexical binding bug