Fix memory leaks
Updated delegates