fix calling delegate function