trying to solve mem leak