mem leak fixed