Added delegate cache to the createDelegate code