Added some debug message to identify the issue with the memory check