fix nil delegate before releasing