added better delegate callbacks.