fixing global leak