Added create dialog function