check for directory existence before calculating sizeInBytes