adding file debug logging logic