set f=null to allow gc