fixes the issue for document's name

Solves #160 
And also corrects the problem for FileDialog cancel button in case of Open and Save.