Fixed jquery UI dialogs bug