logging the error that can happen while creating directories