Adding more debug information and code to fix file in use case