Mem leak fixed