remove global, callback correctly