Fixed wrong free memory