Dialog boxes fully functional. Now they close when end of dialog is
reached.