Added some logging for debugging purposes