debugs and add error information abount failing to open the directory.