fix for global exits, maybe