fixed 2 potential double frees