Fixed dialog format and fixed js syntax