fix bug on safari and add dialog component