Checking if it's a directory before performing scandisk