added log array and last cmd