added log statements to keep track of lifecycle