Added some debug logging