Add the check of fileopen