Issue #64 fix

Introduced a `hasUnSaved` function to check if the content has unsaved changes. 
Now, when clicked 'Close editor' button, `checkSaved` function uses `hasUnSaved` function. This prevent #64 bug.