Added code to trap problem when opening a new project and then canceling the dialog