fix pattern bindings preferring the old environment