added logging to show end of lifecycle