Simplified the check for unsaved changes in subtabs