updated to support lexical-binding.