Added some logging to help with troubleshooting