BUG-FIX Changed regexp for including global scope chain with function