fix dynamics double free