added dialog for errors