Add a previously removed check before trying to access files and  build content metadata