added log statements and fxn call