fixed delegate bug