change wrapper to only work on globals