added log debugging