Retain delegate for duration of the function