resolve EISDIR error