Made Error Dialog work