check if supplied path is a directory