added log creation code