check by file not directory