Adding some debug logging