Solved bug (check only dir not file)