Added a debug code as per jpetto's comment