use didreturn in delegate correctly