change "view" check and closeAllFiles API added.