Added some log calls for debugging